const fn = () => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve(1);
      console.log(1);
    }, 2000);
  });
};

const fn2 = () => {
  fn().then((res) => {
    console.log(res);
  });
};

fn2();
